#define _CRT_SECURE_NO_WARNINGS

#include "HashTable.h"

void test_hashtable1()
{
	int a[] = { 19,30,52,63,11,22,15,32,28,34,13,23,24,31 };
	HashTable<int, int> hash;
	for (auto& e : a)
	{
		hash.insert({ e, e });
	}
}

void test_hashtable2()
{
	HashTable<int, int> hash;
	for (int i = 0; i < 200; i++)
	{
		hash.insert({ i, i });
	}
}

void test_hashtable3()
{
	int a[] = { 19,30,52,63,11,22,15,32,28,34,13,23,24,31 };
	HashTable<int, int> hash;
	for (auto& e : a)
	{
		hash.insert({ e, e });
	}

	cout << hash.find(19) << endl;
	hash.erase(19);
	cout << hash.find(19) << endl;
}

void test_hashtable4()
{
	HashTable<string, int> hash;
	hash.insert({ "counsel", 1 });
	hash.insert({ "norm", 2 });
	hash.insert({ "echo", 3 });
	hash.insert({ "serve", 4 });
	hash.insert({ "fuss", 5 });

	cout << hash.find("echo") << endl;
	hash.erase("echo");
	cout << hash.find("echo") << endl;
}

int main()
{
	test_hashtable4();

	return 0;
}